package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class Test4 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method[] methods = cls.getDeclaredMethods();
        int count = 0;
        for (Method method : methods){
            boolean isAutoRunMethod = method.isAnnotationPresent(AutoRunMethod.class);
            if (isAutoRunMethod== true)
                count+=method.getAnnotation(AutoRunMethod.class).value();

        }
        System.out.println(count);
    }
}
